<template>
    <view class="s-padding">
		<view class="pic_list">
			<view v-for="(item,index) in list" :key="index" class="pic_item">
				<image :src="item.image_url" mode="widthFix" class="pic" @tap="pic_click(item)"/>
				<view v-if="item.title">{{item.title}}</view>
				<view class="s-tabbar">
					<view class="s-btn-mr">
						<s-button type="danger" :plain="true" size="mini" shape="circle"  @tap="pic_detall(item)">查看详情</s-button>
					</view>
				</view>
			</view>
		</view>
    </view>
</template>
<script>
export default {
  name: 'cLiveList',
  data () {
    return {
    }
  },
  props: {
	  list: {
	    type: Array,
	    default: function () {
			return []
		}
	  }
  },
  watch: {
    
  },
  methods: {
	  // 广告位跳转
	  async pic_click(item){
	  	if(item.the_jump == 0){
	  		return;
	  	}else if(item.the_jump == 1){
	  		return await this.$s.uniApi.navigateTo({url:'../out/out?url='+item.url});
	  	}else if(item.the_jump == 2){
	  		let customParams = encodeURIComponent(JSON.stringify({ path: 'pages/index/index', pid: 1 }))
	  		return await this.$s.uniApi.navigateTo({url:item.url+"custom_params="+customParams})
	  	}else if(item.the_jump == 3){
	  		return await this.$s.uniApi.navigateTo({url:'../swiper_detail/swiper_detail?id='+item.id});
	  	}
	  },
	  // 广告查看详情
	  async pic_detall(item){
	  	return await this.$s.uniApi.navigateTo({url:'../pic_detall/pic_detall?id='+item.id})
	  }
  }
}
</script>
<style lang="scss" scoped>
@import 'live-list.scss';
</style>